package com.styytech.dadabao.test.ResideMenu;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

import com.styytech.dadabao.widge.ResideMenu.ResideMenu;
import com.styytech.dadabao.R;

/**
 * User: special
 * Date: 13-12-22
 * Time: 下午3:28
 * Mail: specialcyci@gmail.com
 */
public class SettingsFragment extends Fragment implements OnClickListener {
	public Button button;
	 private View parentView;
	private ResideMenu resideMenu;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    	 parentView = inflater.inflate(R.layout.test_settings, container, false);
    	return parentView;
    }

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);
		((MenuActivity) getActivity()).settingsFragment = this;
		init();
	}

	private void init() {
		// TODO Auto-generated method stub
		button=(Button)getActivity().findViewById(R.id.button1);
		button.setOnClickListener(this);
	    MenuActivity parentActivity = (MenuActivity) getActivity();
	    resideMenu = parentActivity.getResideMenu();
	    /*if (!resideMenu.isOpened()) {
	    	 LinearLayout ignored_view1 = (LinearLayout) parentView.findViewById(R.id.sss);
	         resideMenu.addIgnoredView(ignored_view1);
		}else {
			 LinearLayout ignored_view1 = (LinearLayout) parentView.findViewById(R.id.sss);
			resideMenu.removeIgnoredView(ignored_view1);
		}*/
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.button1:
			startActivity(new Intent(getActivity(),ActivityOne.class));
			break;

		default:
			break;
		}
	}
    
}
